Use the various options of the screen painter to place the text fields, input/output fields, pushbuttons required for the 2 screens.
Define the Screen Element Attributes
As far as possible, use dictionary data elements for the input/output fields so that the required attributes will be automatically set by SAP and the basic automatic validations checks will also be done by SAP.
o set the attributes of each field, select the field and double click on it to open the Attributes Screen.
Define the ok code field in the field list for the Screens
Whenever user does any interaction with the screens, a field is required to trap the action that the user is trying to perform. To do this, define 4 character variable by the name v_okcode_screennumber.
Assign function codes to the various buttons on the screen that the user is likely to press.
These function codes are then transferred via the variable to the flow logic of the screen, to decide the path to be taken by the flow of the transaction.
Write the Flow Logic
Now let us write the flow logic for both the screens.
Screen 100
Process before output.
Module status_0100.
*
Process after inout.
Module User_Command_0100.
Screen 200
Process before output.
Module status_0200.
*
Process after inout.
Module exitscreen at exit-command.
Field ztryemp-name module check_name.
Field ztryemp-phone module check_phone.
Field ztryemp-basic module check_basic.
Module User_Command_0200.
To add the code to each module, double click on the module. This will bring up a screen asking you to select the proper sub program from the module pool to place the code in it. Select the proper PBO, PAI and Form program to include the respective code.
We will first see the PBO sub-program for both screens.
PBO modules are used for initializing variables, assigning the pf-statuses and titlebars for dynpros, and other screen processing to be done before the screen is displayed and re-displayed.